{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑领域标签</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <input type="hidden" name="id" value="{$id}">
                            <label class="layui-form-label">名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="realm_name" value="{$info['realm_name']}" max="6" lay-verify="required" class="layui-input ">
                            </div>
                            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="component-form-element">编辑
                                    </button>
                                    <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {include file="public/footer" /}
    <script>
        layui.use(['form','upload','layedit'], function() {
            var form = layui.form;
            form.on('submit(component-form-element)', function (data) {
                $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
                $.ajax({
                    url:"{:url('update')}",
                    type:'post',
                    dataType:'json',
                    data:data.field,
                    success:function(res){
                        if (res.code == 200) {
                            wk.success(res.msg,"{:url('realm/index')}")
                        } else {
                            wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                        }
                    }
                })
            });
        });
    </script>

</body>
</html>
